home *** CD-ROM | disk | FTP | other *** search
Wrap
<% '+------------------------------------------------------------------------- ' ' Microsoft Windows Media ' Copyright (C) Microsoft Corporation. All rights reserved. ' ' File: Toolbar.asp ' ' Contents: Draws the toolbar found on the bottom of each page ' ' Dependencies: LocStrings.asp, WMSConstnats.asp ' '-------------------------------------------------------------------------- rem *** paths to PUBLISHING POINT tabs' images *** Const IMAGE_PP_ADD = "img/addpp_icon32.gif" Const IMAGE_PP_PPADD = "img/addppt_icon32.gif" Const IMAGE_PP_STARTRECORD = "img/startrecord_icon32.gif" Const IMAGE_PP_STARTRECORDG = "img/startrecordg_icon32.gif" Const IMAGE_PP_STOPRECORD = "img/stoprecord_icon32.gif" Const IMAGE_PP_STOPRECORDG = "img/stoprecordg_icon32.gif" Const IMAGE_PP_START = "img/start_icon32.gif" Const IMAGE_PP_STARTG = "img/startg_icon32.gif" Const IMAGE_PP_DISCONNECT = "img/disconnect_icon32.gif" Const IMAGE_PP_DISCONNECTG = "img/disconnectg_icon32.gif" Const IMAGE_PP_ONDEMAND = "img/ondemand_icon32.gif" Const IMAGE_PP_ONDEMANDSTOP = "img/ondemand_stop32.gif" Const IMAGE_PP_ONDEMAND_ERR = "img/ondemand_error32.gif" Const IMAGE_PP_ONDEMAND_DENY = "img/ondemand_deny32.gif" Const IMAGE_PP_BROADCASTENDED = "img/BroadcastPushStreamEnd_32.gif" Const IMAGE_PP_BROADCAST = "img/broadcast_icon32.gif" Const IMAGE_PP_BCASTSTOPPED = "img/broadcast_stop32.gif" Const IMAGE_PP_BROADCAST_ERR = "img/broadcast_error32.gif" Const IMAGE_PP_BROADCAST_DENY = "img/broadcast_deny32.gif" Const IMAGE_PP_BROADCAST_PUSH = "img/broadcast_push32.gif" Const IMAGE_PP_BCASTDENY_PUSH = "img/BroadcastPushDeny_32.gif" Const IMAGE_PP_BCASTSTOP_PUSH = "img/BroadcastPushStop_32.gif" Const IMAGE_PP_BCASTERR_PUSH = "img/BroadcastPushCritical_32.gif" Const IMAGE_PP_DUP = "img/duplicateppt_icon32.gif" rem *** paths to SERVER tabs' images *** Const IMAGE_SERVER = "img/server_icon32.gif" Const IMAGE_SERVERSTOP = "img/server_stop_32.gif" Const IMAGE_SERVERDENY = "img/server_deny32.gif" Const IMAGE_SERVERERR = "img/server_error32.gif" Const IMAGE_SERVERWARN = "img/server_warning32.gif" Const IMAGE_STOP = "img/stop_icon32.gif" Const IMAGE_ALLOWCONNECTIONS = "img/allownew_icon32.gif" Const IMAGE_DENYCONNECTIONS = "img/denynew_icon32.gif" Const IMAGE_ALLOWCONNECTIONSG = "img/allownewg_icon32.gif" Const IMAGE_DENYCONNECTIONSG = "img/denynewg_icon32.gif" Const IMAGE_RESETPEAKS = "img/resetpeak_icon32.gif" Const IMAGE_ENABLE = "img/enable_icon32.gif" Const IMAGE_ENABLEG = "img/enableg_icon32.gif" Const IMAGE_DISABLE = "img/disable_icon32.gif" Const IMAGE_DISABLEG = "img/disableg_icon32.gif" Const IMAGE_REMOVE = "img/remove_icon_32.gif" Const IMAGE_REMOVEG = "img/removeg_icon32.gif" Const IMAGE_RENAME = "img/rename_icon32.gif" Const IMAGE_RENAMEG = "img/renameg_icon32.gif" Const IMAGE_PLUGINDUPLICATE = "img/dupplugin_icon32.gif" Const IMAGE_PLUGINDUPLICATEG = "img/duppluging_icon32.gif" Const IMAGE_PROPERTIES = "img/properties_icon32.gif" Const IMAGE_PROPERTIESG = "img/propertiesg_icon32.gif" Const IMAGE_REFRESH = "img/refresh_icon32.gif" Const IMAGE_CLEARLIST = "img/clearall_icon32.gif" Const IMAGE_CLEARLISTG = "img/clearallg_icon32.gif" Const IMAGE_HELP = "img/help_icon32.gif" Const IMAGE_SERVERLIST = "img/serverlist_icon32.gif" Const IMAGE_STOPG = "img/stopg_icon32.gif" Const IMAGE_STARTG = "img/startg_icon32.gif" rem *** paths to tabs' help *** Const SERVERHELP_PATH = "../help/default.htm" Const PUBPOINTHELP_PATH = "../../help/default.htm" Const SERVERSLIST_PATH = "JavaScript:ShowServerList();" Const PUBPOINTSLIST_PATH = "/wmssecure/pages/pubpoints/pubpoint_collection.asp?show=true" Const SLISTTARGET = "target=sList" Const HELPTARGET = "target=help" Const QUOTE_CHAR = 34 Const ICON_SIZE = 32 Const TOOLBARWRAP = 11 rem *** do not localize Const HELPTOKEN = "_HELP" Dim ToolbarButtonText( 12 ) Dim ToolbarButtonAltText( 12 ) Dim ToolbarButtonImage( 12 ) Dim ToolbarButtonImageDisabled( 12 ) Dim ToolbarButtonLink( 12 ) Dim ToolbarButtonLinkArgs( 12 ) Dim ToolbarHelpURL Dim ToolbarNesting g_dwBrowserType = Session( "BrowserType" ) '///////////////////////////////////////////////////////////////////////////////////// ' ' Called at the bottom of a page implementing error handling. Determines if we need ' to re-load the page to display error messages or just clear the error state vars. ' sub DrawToolbar( bIsPubPoint, dwNumElements ) on error resume next Response.Flush Dim i Dim bDisabledImageSpecified %> <!-- BEGIN TOOLBAR --> <div id="toolbarTable"> <table cellspacing="0" cellpadding="0" border="0" oncontextmenu="JavaScript:event.cancelBubble=true;return false;"> <tr> <% bDisabledImageSpecified = FALSE i = 0 while( ( i < 12 ) and ( not bDisabledImageSpecified ) ) if( "" <> ToolbarButtonImageDisabled( i ) ) then bDisabledImageSpecified = TRUE end if i = i + 1 wend i = 0 while( i < dwNumElements ) if( 12 <= Len( ToolbarButtonText( i ) ) ) then if( TRUE = LONGTOOLBARNAMES ) then dwButtonWidth = 105 dwButtonHeight = 105 else dwButtonWidth = 85 dwButtonHeight = 85 end if else dwButtonWidth = 72 dwButtonHeight = 72 end if ' Wrap the toolbar if it is too long if( ( 0 <> i ) and ( 0 = i mod TOOLBARWRAP ) ) then %></tr><tr><% end if %> <td valign="top"> <center><% if( 0 < Len( ToolbarButtonLink( i ) ) ) then if( HELPTOKEN = ToolbarButtonLink( i ) ) then %> <table hspace="2px" vspace="2px" align="middle" valign="top" border="0" cellspacing="5" cellpadding="0" height="<%= dwButtonHeight %>" width="<%= dwButtonWidth %>"> <tr> <td valign="top" onclick="<% if bDisabledImageSpecified then %>Check<% end if %>OnClickToolbar( 'toolbar_<%= i %>', 'toolbarLink_<%= i %>' );" > <center> <div onclick="<% if bDisabledImageSpecified then %>Check<% end if %>OnClickToolbar( <%= i %>, 'toolbar_<%= i %>', 'toolbarLink_<%= i %>' );" onmousedown="<% if bDisabledImageSpecified then %>Check<% end if %>OnMouseDown( <%= i %>, 'toolbar_<%= i %>' );" onmouseenter="<% if bDisabledImageSpecified then %>Check<% end if %>OnMouseEnter( <%= i %>, 'toolbar_<%= i %>' );" onlosecapture="<% if bDisabledImageSpecified then %>Check<% end if %>ResetToolbarEntry( <%= i %>, 'toolbar_<%= i %>' );" onmouseleave="<% if bDisabledImageSpecified then %>Check<% end if %>OnMouseLeave( <%= i %>, 'toolbar_<%= i %>' );" title="<%= ToolbarButtonAltText( i ) %>" class="toolbarnormal" name="toolbar_<%= i %>" id="toolbar_<%= i %>"> <a class="toolbarnormal" id="toolbarLink_<%= i %>" href="JavaScript:DoHelp('<%= ToolbarNesting %>','<%= ToolbarHelpURL %>');" tabIndex=<%= dwTabIndex %> <% dwTabIndex = dwTabIndex + 1 %>><% else %> <table hspace="2px" vspace="2px" align="middle" valign="top" border="0" cellspacing="5" cellpadding="0" height="<%= dwButtonHeight %>" width="<%= dwButtonWidth %>"> <tr> <td valign="top" onclick="OnClickToolbar( 'toolbar_<%= i %>', 'toolbarLink_<%= i %>' );" > <center> <div onclick="<% if bDisabledImageSpecified then %>Check<% end if %>OnClickToolbar( <%= i %>, 'toolbar_<%= i %>', 'toolbarLink_<%= i %>' );" onmousedown="<% if bDisabledImageSpecified then %>Check<% end if %>OnMouseDown( <%= i %>, 'toolbar_<%= i %>' );" onmouseenter="<% if bDisabledImageSpecified then %>Check<% end if %>OnMouseEnter( <%= i %>, 'toolbar_<%= i %>' );" onlosecapture="<% if bDisabledImageSpecified then %>Check<% end if %>ResetToolbarEntry( <%= i %>, 'toolbar_<%= i %>' );" onmouseleave="<% if bDisabledImageSpecified then %>Check<% end if %>OnMouseLeave( <%= i %>, 'toolbar_<%= i %>' );" title="<%= ToolbarButtonAltText( i ) %>" class="toolbarnormal" name="toolbar_<%= i %>" id="toolbar_<%= i %>"> <a class="toolbarnormal" id="toolbarLink_<%= i %>" href="<%= ToolbarButtonLink( i ) %>" <%= ToolbarButtonLinkArgs( i ) %> tabIndex=<%= dwTabIndex %> <% dwTabIndex = dwTabIndex + 1 %>><% end if else %> <table align="middle" valign="top" border="0" cellspacing="5" cellpadding="0" height="<%= dwButtonHeight %>" width="<%= dwButtonWidth %>" disabled > <tr> <td valign="top" > <center> <div class="toolbargray"><% end if %> <img ID="toolbarImage<%= i %>" src="<%= ToolbarButtonImage( i ) %>" border="0" width="<%= ICON_SIZE %>" height="<%= ICON_SIZE %>"<% if( "" <> ToolbarButtonAltText ) then %> ALT= "<%= ToolbarButtonAltText( i ) %>"<% end if %> ><br><%= ToolbarButtonText( i ) %> <% if( "" <> ToolbarButtonLink( i ) ) then %></a><% end if %> </div> </center> </td> </tr> </table> </center> </td valign="top"><% i = i + 1 wend %> </tr> </table> </div> <% if bDisabledImageSpecified then %> <script language="JavaScript"> /*@cc_on @*/ <% if brMSIE = g_dwBrowserType then %> var g_rgEnabledImages = new Array(); var g_rgDisabledImages = new Array(); var g_rgEnabled = new Array(); var g_bPopulated = false; var g_bToolbarLoaded = false; <% end if %> ///////////////////////////////////////////////////////////////// function PopulateArrays( dwWhichItem ) { <% jsTRY %> <% if( brMSIE <> g_dwBrowserType ) then %>return;<% else %> g_bPopulated = true; <% i = 0 while( i < dwNumElements ) if( 0 < Len( ToolbarButtonImageDisabled( i ) ) ) then %> g_rgEnabledImages[ <%= i %> ] = new Image(); g_rgEnabledImages[ <%= i %> ].src = "<%= ToolbarButtonImage( i ) %>"; g_rgDisabledImages[ <%= i %> ] = new Image(); g_rgDisabledImages[ <%= i %> ].src = "<%= ToolbarButtonImageDisabled( i ) %>"; <% end if i = i + 1 wend i = 0 while( i < dwNumElements ) %> g_rgEnabled[ <%= i %> ] = true; <% i = i + 1 wend %> <% end if %> <% jsCATCH %> } ///////////////////////////////////////////////////////////////// function CheckOnMouseDown( dwWhichItem, szToolbarItem ) { <% jsTRY %> <% if( brMSIE <> g_dwBrowserType ) then %>return;<% else %> if( ! g_bToolbarLoaded ) { return; } if( ! g_bPopulated ) { PopulateArrays(); } if( g_rgEnabled[ dwWhichItem ] ) { OnMouseDown( szToolbarItem ); } <% end if %> <% jsCATCH %> } ///////////////////////////////////////////////////////////////// function CheckOnClickToolbar( dwWhichItem, szName, szLinkName ) { <% jsTRY %> <% if( brMSIE <> g_dwBrowserType ) then %>return;<% else %> if( ! g_bToolbarLoaded ) { return; } if( ! g_bPopulated ) { PopulateArrays(); } if( g_rgEnabled[ dwWhichItem ] ) { OnMouseUp( szName ); OnClickToolbar( dwWhichItem, szName, szLinkName ); } else { // ResetToolbarEntry( dwWhichItem, szName ); event.cancelBubble=true; return( false ); } <% end if %> <% jsCATCH %> } ///////////////////////////////////////////////////////////////// function CheckOnMouseEnter( dwWhichItem, szName ) { <% jsTRY %> <% if( brMSIE <> g_dwBrowserType ) then %>return;<% else %> if( ! g_bToolbarLoaded ) { return; } if( ! g_bPopulated ) { PopulateArrays(); } var szItemName = "toolbar_" + dwWhichItem; var szItemLinkName = "toolbarLink_" + dwWhichItem; if( g_rgEnabled[ dwWhichItem ] ) { OnMouseEnter( dwWhichItem, szName ); document.all[ szItemName ].style.cursor = "hand"; document.all[ szItemLinkName ].style.cursor = "hand"; } else { document.all[ szItemName ].style.cursor = "default"; document.all[ szItemLinkName ].style.cursor = "default"; } <% end if %> <% jsCATCH %> } ///////////////////////////////////////////////////////////////// function CheckResetToolbarEntry( dwWhichItem, szName ) { <% jsTRY %> <% if( brMSIE <> g_dwBrowserType ) then %>return;<% else %> if( ! g_bToolbarLoaded ) { return; } if( ! g_bPopulated ) { PopulateArrays(); } if( g_rgEnabled[ dwWhichItem ] ) { ResetToolbarEntry( dwWhichItem, szName ); } <% end if %> <% jsCATCH %> } ///////////////////////////////////////////////////////////////// function CheckOnMouseLeave( dwWhichItem, szName ) { <% jsTRY %> <% if( brMSIE <> g_dwBrowserType ) then %>return;<% else %> if( ! g_bToolbarLoaded ) { return; } if( ! g_bPopulated ) { PopulateArrays(); } if( g_rgEnabled[ dwWhichItem ] ) { OnMouseLeave( dwWhichItem, szName ); } <% end if %> <% jsCATCH %> } ///////////////////////////////////////////////////////////////// function EnableToolbarItem( dwWhichItem, bEnable ) { <% jsTRY %> <% if( brMSIE <> g_dwBrowserType ) then %>return;<% else %> if( ! g_bPopulated ) { PopulateArrays(); } if( dwWhichItem >= <%= dwNumElements %> ) { return; } var szLinkName = new String( "toolbarLink_" ); szLinkName += dwWhichItem; var szImageName = new String( "toolbarImage" ); szImageName += dwWhichItem; if( document.all[ szLinkName ] ) { document.all[ szLinkName ].disabled = ! bEnable; } g_rgEnabled[ dwWhichItem ] = bEnable; if( bEnable ) { if( ( document.images[ szImageName ] ) && ( g_rgEnabledImages[ dwWhichItem ] ) ) { document.images[ szImageName ].src = g_rgEnabledImages[ dwWhichItem ].src; } } else { if( ( document.images[ szImageName ] ) && ( g_rgDisabledImages[ dwWhichItem ] ) ) { document.images[ szImageName ].src = g_rgDisabledImages[ dwWhichItem ].src; } } var szItemName = "toolbar_" + dwWhichItem; if( bEnable ) { if( document.all[ szItemName ] ) { document.all[ szItemName ].style.cursor = "hand"; } } else { if( document.all[ szItemName ] ) { document.all[ szItemName ].style.cursor = "default"; // = "toolbargray"; } } <% end if %> <% jsCATCH %> } </script> <% end if %> <!-- END TOOLBAR --> <% End Sub %>